
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <link href="../css/table.css" rel="stylesheet">
    <script src="../javaScript/table.js" type="module"></script>
</head>
<body>
<table class="myTable" id="myTable">

    <thead>
    <tr>
        <th>id</th>
        <th>姓名</th>
        <th>昵称</th>
        <th>密码</th>
        <th>性别</th>
        <th>邮箱</th>
        <th>电话</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody id="myTbody">
    <c:forEach items="${requestScope.page.list}" var="row">
        <tr>
            <td>${row.id}</td>
            <td>${row.user_name}</td>
            <td>${row.nick_name}</td>
            <td>${row.password}</td>
            <td>${row.sex==1?"男":"女"}</td>
            <td>${row.email}</td>
            <td>${row.phone}</td>
            <td >
                <nav class="rowOption">
                    <div class="divButton deleteButton" ></div>
                    <span>删除</span>
                    <div class="divButton operationButton"></div>
                    <span>修改</span>
                </nav>
            </td>
        </tr>
    </c:forEach>
    </tbody>
    <tfoot>
    <tr>
        <td colspan="8">
            <nav class="operationGroup">
                <button class="divButton addButton" id="btn_addTd"value="${requestScope.addFlag}"></button>
                <div class="inputDiv">
                    <form action="user.Servlet?param=table" method="post">
                        <input type="text" id="keyword" name="keyword" >&nbsp;&nbsp;
                        <button type="submit" >查询</button>
                    </form>

                </div>

            </nav>

            <nav class="page" id="pageGroup">
                当前第<span id="currentPage">${requestScope.page.currentPage}</span>页
                &nbsp;&nbsp;
                共<span id="totalPageNumber">${requestScope.page.totalPageNumber}</span>页
                &nbsp;&nbsp;
                <c:if test="${requestScope.page.currentPage==1}">首页</c:if>
                <c:if test="${requestScope.page.currentPage!=1}">
                    <a href="#" id="firstPage">首页</a>
                </c:if>
                &nbsp;&nbsp;
                <c:if test="${requestScope.page.currentPage==1}">上一页</c:if>
                <c:if test="${requestScope.page.currentPage!=1}">
                    <a href="#" id="previousPage">上一页</a>
                </c:if>
                <select name="jumpPage" id="jumpPage">
                    <c:forEach begin="1" end="${requestScope.page.totalPageNumber}" var="i">
                        <c:if test="${i==requestScope.page.currentPage}">
                            <option selected name="aaa" value="${i}">${i}</option>
                        </c:if>
                        <c:if test="${i!=requestScope.page.currentPage}">
                            <option name="aaa" value="${i}">${i}</option>
                        </c:if>
                    </c:forEach>
                </select>

                <c:if test="${requestScope.page.currentPage==requestScope.page.totalPageNumber}">下一页</c:if>
                <c:if test="${requestScope.page.currentPage!=requestScope.page.totalPageNumber}">
                    <a href="#" id="nextPage">下一页</a>
                </c:if>
                &nbsp;&nbsp;
                <c:if test="${requestScope.page.currentPage==requestScope.page.totalPageNumber}">尾页</c:if>
                <c:if test="${requestScope.page.currentPage!=requestScope.page.totalPageNumber}">
                    <a href="#" id="lastPage">尾页</a>
                </c:if>

            </nav>
        </td>
    </tr>
    </tfoot>
</table>
</body>
</html>
